// // import TodoList from './components/todo-list';
// import { useState } from 'react';
// import Counter from './components/counter';
// import { Input } from 'antd';

// export default function App() {

//   const [inputValue, setInputValue] = useState('');

//   return (
//     <div className="App">
//       {/* {
//         inputValue &&
//         <Counter msg={ inputValue } />
//       }
//       <Input onChange={ (e) => setInputValue(e.target.value) } /> */}

//     </div>
//   );
// }

import { Routes, Route, useNavigate } from "react-router-dom";
import routes from './router';
import { Button } from 'antd';

export default function App(props: any) { // to fix

  const go = useNavigate();

  return (
    <div className="App">
      {/* <Link to="/counter">计数器</Link>
      <Link to="/todo-list">todolist</Link> */}
      <Button onClick={ () => go('/counter') }>计数器</Button>
      <Button onClick={ () => go('/todo-list') }>todolist</Button>
      <Routes>
        {
          routes.map(route =>
            <Route
              key={ route.path }
              path={ route.path }
              element={ route.component }
            />
          )
        }
      </Routes>
    </div>
  );
}
